package mtm.db;

import mtm.date.MtmDate;

public class Job extends AbstractJob {
	
	public static final int NO_ALERT = 0;
	public static final int DIALOG_ALERT = 1;
	
	protected int parentId = -1;
	
	
	/**
	 * Constructor
	 */
	public Job() {
		super();
	}
	
	
	/**
	 * Constructor
	 */
	public Job(String jobName, MtmDate startTime, MtmDate endTime, String description, 
			String icon, int color) {
		super(jobName, startTime, endTime, description, icon, color);
	}
	
	
	/**
	 * Constructor
	 */
	public Job(String jobName, MtmDate startTime, MtmDate endTime, 
			String description) {
		super(jobName, startTime, endTime, description);
	}
	
	
	@Override
	public String toString() {
		return "( " + id + "," +  jobName + ", " + startTime.toString() + ", " + endTime.toString() 
					+ ", " + description + ", " + icon + ", " + color + ", "
					+ ", " + parentId +  " )";
	}
	

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}
	
	public boolean isGeneratedJob() {
		if (parentId == -1) {
			return false;
		}
		
		return id == 0;
	}
}
